{% extends 'base.html' %}
{% block css %}
<!-- iCheck -->
<link href="/static/css/green.css" rel="stylesheet">
<link href="/static/css/bootstrapValidator.min.css" rel="stylesheet">
{% endblock %}
{% block content %}
<div class="right_col" role="main">
    <div class="">
        <div class="clearfix"></div>

        <div class="row">
            <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="tabbable" id="tabs-754998">
                    <ul class="nav nav-tabs">
                        <li class="active">
                        <a href="#panel-single" data-toggle="tab">单机管理</a>
                        </li>
                        <li>
                        <a href="#panel-group" data-toggle="tab">批量管理</a>
                        </li>
                    </ul>

                    <div class="x_panel" style="border-top:none;">
                        <div class="x_title">
                            <h2>远程管理 </h2>
                            <ul class="nav navbar-right panel_toolbox">
                                <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                                </li>
                                <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-wrench"></i></a>
                                <ul class="dropdown-menu" role="menu">
                                    <li><a href="#">Settings 1</a>
                                    </li>
                                    <li><a href="#">Settings 2</a>
                                    </li>
                                </ul>
                                </li>
                                <li><a class="close-link"><i class="fa fa-close"></i></a>
                                </li>
                            </ul>
                            <div class="clearfix"></div>
                        </div>
                        <div class="x_content">
                            <form action="rem_exec" method="post">
                                <div>
                                        <select name="host_ip">
                                            <option value = "">---选择host---</option>
                                                {% for host in host_list %}
                                            <option value = "{{ host }}">{{ host }}</option>
                                                {% endfor %}
                                        </select>
                                        <input type="text" name="exec_commond" placeholder="请输入要执行的命令" />
                                        <input type="submit" value="提交查询" />
                                </div>
                            </form>

                            <div>
                                <h2>查询结果展现</h2>
                                <div style="border: solid 2px;width: auto;height: 100px">
                                    <span style="color: #00aeef">
                                        {% for k,v in result.items %}
                                            {{ v }}
                                        {% endfor %}
                                    </span>

                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                    <div id="result"></div>
                    <!-- 模态框（Modal） -->
                    <div class="modal fade" id="result-modal-salt" tabindex="-1" role="dialog" aria-labelledby="result-modal" aria-hidden="true">
                        <div class="modal-loading"></div>
                        <div class="modal-dialog">
                            <div class="modal-content" style="background-color:#272822;color:#00ff00;">
                                <div class="modal-header" style="border-bottom:1px solid #666">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                    <b class="modal-title" id="result-modal" style="color:#f8f8f2">运行结果</b>&nbsp;
                                    <a href="#" onclick="122" role="button" class="btn btn-dark btn-xs">重新查询</a>
                                    <a href="#" onclick="collapse(this);" state="0" role="button" class="btn btn-dark btn-xs">展开所有</a>
                                </div>
                                <div id="modal-body" class="modal-body">
                                    <div class="panel-group" id="accordion">
                                    </div>
                                </div>
                                <!--<div class="modal-footer">

                                </div>-->
                            </div><!-- /.modal-content -->
                        </div><!-- /.modal-dialog -->
                    </div><!-- /.modal -->

                <input type="hidden" class="form-control" value="" id="jid">
                <input type="hidden" class="form-control" value="" id="exec_type">

            </div>
        </div>
    </div>
</div>
{% endblock %}

{% block js %}
{#<script src="/static/js/bootstrapValidator.min.js"></script>#}
<script type="text/javascript" src="/static/js/icheck.min.js"></script>
<script type="text/javascript" src="/static/js/bootstrap-modal-vertical.js"></script>
<script src="/static/js/csrf.js"></script>
<script src="/static/js/salt_result.js"></script>
{% endblock %}
